package com.jsb.laundry.service.impl;

import com.jsb.laundry.dao.RiderUserInfoDao;
import com.jsb.laundry.model.dto.UpdUserInfoRequest;
import com.jsb.laundry.model.entity.Withdrawals;
import com.jsb.laundry.model.vo.*;
import com.jsb.laundry.service.RiderUserInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class RiderUserInfoServiceImpl implements RiderUserInfoService {
    @Resource
    private RiderUserInfoDao riderUserInfoDao;

    /**
     * 站点列表
     *
     * @return
     */
    @Override
    public List<ShopsSiteListVo> findBySite() {
        return riderUserInfoDao.findBySite();
    }

    /**
     * 修改个人信息
     *
     * @param userInfoRequest
     * @return
     */
    @Override
    public int updUserInfo(UpdUserInfoRequest userInfoRequest) {
        return riderUserInfoDao.updUserInfo(userInfoRequest);
    }

    /**
     * 查询骑手是否关注公众号
     *
     * @param userId
     * @return
     */
    @Override
    public int findByFollow(String userId) {
        return riderUserInfoDao.findByFollow(userId);
    }

    /**
     * 待结算列表
     *
     * @param userId
     * @return
     */
    @Override
    public List<CapitalAccountUnstLogListVo> capitalAccountUnstLogList(String userId) {
        return riderUserInfoDao.capitalAccountUnstLogList(userId);
    }

    /**
     * 已结算
     *
     * @param userId
     * @return
     */
    @Override
    public List<CapitalAccountUnstLogListVo> capitalAccountLogList(String userId) {
        return riderUserInfoDao.capitalAccountLogList(userId);
    }

    /**
     * 题库列表
     *
     * @return
     */
    @Override
    public List<QuestionBankVo> findByList() {
        return riderUserInfoDao.findByList();
    }

    /**
     * 查询所以题目
     *
     * @return
     */
    @Override
    public List<QuestionBankVo> findByLists() {
        return riderUserInfoDao.findByLists();
    }

    /**
     * 用户得分
     *
     * @param userId
     * @param fraction
     * @return
     */
    @Override
    public int addLog(String userId, String fraction) {
        return riderUserInfoDao.addLog(userId, fraction);
    }

    /**
     * 查询用户答题次数
     *
     * @param userId
     * @return
     */
    @Override
    public int findByQuestionCount(String userId) {
        return riderUserInfoDao.findByQuestionCount(userId);
    }

    /**
     * 查询用户绑定的站点
     *
     * @param userId
     * @return
     */
    @Override
    public String userSite(String userId) {
        return riderUserInfoDao.userSite(userId);
    }

    /**
     * 今日收入
     *
     * @param userId
     * @param startTime
     * @param endTime
     * @return
     */
    @Override
    public int todayMoney(String userId, String startTime, String endTime) {
        return riderUserInfoDao.todayMoney(userId, startTime, endTime);
    }

    /**
     * 今日单量
     *
     * @param userId
     * @param startTime
     * @param endTime
     * @return
     */
    @Override
    public int todayNumber(String userId, String startTime, String endTime) {
        return riderUserInfoDao.todayNumber(userId, startTime, endTime);
    }

    /**
     * 查询邀请排行榜
     *
     * @return
     */
    @Override
    public List<FindByPromotionVo> findByPromotion() {
        return riderUserInfoDao.findByPromotion();
    }

    /**
     * 查询团队当月业绩
     *
     * @param userId
     * @return
     */
    @Override
    public List<FindByPromotionListVo> findByPromotionList(String userId) {
        return riderUserInfoDao.findByPromotionList(userId);
    }

    /**
     * 查询下我的上级
     *
     * @param userId
     * @return
     */
    @Override
    public FindByParentIdVo findByParentId(String userId) {
        return riderUserInfoDao.findByParentId(userId);
    }

    /**
     * 查询我的客户列表
     *
     * @param userId
     * @return
     */
    @Override
    public List<FindByMyCustomVo> findByMyCustom(String userId) {
        return riderUserInfoDao.findByMyCustom(userId);
    }

    /**
     * 提现列表
     *
     * @param userId
     * @return
     */
    @Override
    public List<RiderWithdrawalLogVo> findByWithdrawalList(String userId) {
        return riderUserInfoDao.findByWithdrawalList(userId);
    }

    /**
     * 提现
     *
     * @param batchNumber
     * @param userId
     * @param money
     * @return
     */
    @Override
    public int addWithdrawalLog(String batchNumber, String userId, int money) {
        return riderUserInfoDao.addWithdrawalLog(batchNumber, userId, money);
    }

    /**
     * 查询用户金额和id
     *
     * @param userId
     * @return
     */
    @Override
    public WithdrawalUserVo findByUserMoney(String userId) {
        return riderUserInfoDao.findByUserMoney(userId);
    }

    /**
     * 添加提现记录
     *
     * @param withdrawals
     * @return
     */
    @Override
    public int addWithdrawalsLog(Withdrawals withdrawals) {
        return riderUserInfoDao.addWithdrawalsLog(withdrawals);
    }

    @Override
    public String findByQuestionInfo() {
        return riderUserInfoDao.findByQuestionInfo();
    }

    @Override
    public int questionNumber(String userId) {
        return riderUserInfoDao.questionNumber(userId);
    }

    @Override
    public String findByIdNumber(String userId) {
        return riderUserInfoDao.findByIdNumber(userId);
    }
}
